package adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.GoodsBean;
import student.andlei.com.student.R;
import utils.ImageLoaderUtils;

/**
 * author : ChenHuiMing
 * date : 2018/9/15
 * email : 907399255@qq.com
 * description : 商城商品
 */
public class MallGoodsAdapter extends BaseQuickAdapter<GoodsBean.Schedule, BaseViewHolder> {
    public MallGoodsAdapter(int layoutResId, @Nullable List<GoodsBean.Schedule> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsBean.Schedule item) {
        ImageView imageView = helper.getView(R.id.iv_book);
        ImageLoaderUtils.loadImage(mContext, item.schedule_image, imageView);
        helper.setText(R.id.tv_title, item.schedule_name).setText(R.id.tv_teacher, "主讲：" + item.teacher_name)
                .setText(R.id.tv_time, item.start_date + " - " + item.end_date).setText(R.id.tv_price, "￥" + item.price);
    }
}
